package 
{
	import com.greensock.events.LoaderEvent;
	import com.greensock.loading.core.LoaderCore;
	import com.greensock.loading.LoaderMax;
	import com.greensock.loading.SWFLoader;
	import com.greensock.loading.XMLLoader;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.filesystem.File;
	import flash.net.SharedObject;
	import flash.system.LoaderContext;
	import flash.ui.Mouse;
	import flash.ui.MouseCursorData;
	import iscript.airFramework.util.FileHelper;
	import iscript.airFramework.util.FolderHelper;
	import iscript.gameFramework.GameLite.Game;
	import iscript.uiFramework.components.button.BaseButton;
	import iscript.uiFramework.UIFramework;
	import View.component.ExplorerMain;
	import flash.system.Security;
	import flash.system.SecurityPanel;
	
	public class Main extends Sprite 
	{
		
		public function Main():void 
		{
			 var game:Game = new Game(stage);
			 
			 stage.scaleMode = StageScaleMode.NO_SCALE;
			 stage.align =  StageAlign.TOP_LEFT;
			 
			LoaderMax.defaultContext = new LoaderContext(false, stage.loaderInfo.applicationDomain);
			var loader:LoaderMax = new LoaderMax();
			loader.append(new SWFLoader("uiResource/UISKin.swf", {name: "UISKINSWF"}));
			loader.append(new XMLLoader("uiResource/UIResourceSetting.xml", {name: "UISKINXML"}));
			loader.addEventListener(LoaderEvent.COMPLETE, _initializeUI);
			loader.load();
			
		}
		
		private function _initializeUI(e:LoaderEvent):void 
		{
			var data:XML = LoaderMax(e.target).getContent("UISKINXML");

			var uiFramework:UIFramework = new UIFramework();
			uiFramework.initialize(stage, data);
			addChild(new ExplorerMain());
		}
		
		
	 
		
	}
	
} 